/**
 * @description 配置文件
 * @author 追追
 */

const { isProd } = require('../utils/env');

let REDIS_CONF = {
    port: 6379,
    host: '127.0.0.1',
};

let MYSQL_CONF = {
    host: 'localhost',
    user: 'root',
    password: 'Ljj.123456',
    port: '3306',
    database: 'koa2_weibo_db',
};

//是否为线上环境
if (isProd) {
    MYSQL_CONF = {
        host: 'localhost',
        user: 'root',
        password: 'Ljj.123456',
        port: '3306',
        database: 'koa2_weibo_db',
    };
    REDIS_CONF = {
        port: 6379,
        host: '127.0.0.1',
    };
}

module.exports = {
    MYSQL_CONF,
    REDIS_CONF,
};
